import Vue from 'vue'
import { navdata } from './config';
import { reg } from './validate';
import { mapState, mapMutations } from 'vuex'
Vue.mixin({
    data() {
        return {
            navdata,
            reg,
        }
    },
    computed: {
        // 引入所有的Vuex 数据
        ...mapState([
            'userInfo',
            'city',
            'cityList'
        ])
    },
    methods: {
        ...mapMutations([
            'changeUserInfo',
            'changeCity',
            'changeCityList'
        ]),
        gotoWhere(options) {
            this.$router.push(options)
        },
        gotoback() {
            this.$router.back()
        },
        showErrMsg(message = '失败') {
            this.$notify({
                message: message,
                color: '#ad0000',
                background: '#ffe1e1',
            });
        }

    },
    mounted() {
        // console.log("我是全局混入的数据，有常用的方法")
    }
})